import request from '@/utils/request'
import downloader from '@/utils/downloader'

//系统用户分页列表
export function adminUserList(data) {
	return request({
		url: '/admin/user/userList',
		method: 'get',
		params: data
	})
}

//获取系统用户信息
export function adminUserInfo(data) {
	return request({
		url: '/user/userInfo',
		method: 'get',
		params: data
	})
}

//添加系统用户
export function adminUserSave(data) {
	return request({
		url: '/admin/user/userSave',
		method: 'post',
		data
	})
}

//修改系统用户
export function adminUserUpdate(data) {
	return request({
		url: '/admin/user/userUpdate',
		method: 'post',
		data
	})
}

//重置系统用户密码
export function resetPassword(data) {
	return request({
		url: '/admin/user/resetPassword',
		method: 'PUT',
		params: data
	})
}

//删除系统用户
export function adminUserRemove(data) {
	return request({
		url: '/admin/user/userRemove',
		method: 'DELETE',
		params: data
	})
}

//批量导入系统用户
export function importAdminUser(data) {
	return request({
		url: '/admin/user/importUser',
		method: 'post',
		data
	})
}

//导出系统用户
export function adminUserExport(data) {
	return downloader({
		url: '/admin/user/userExport',
		method: 'get',
		params: data
	})
}

//修改用户密码
export function updatePassword(data) {
	return request({
		url: '/admin/user/adminUser/updatePassword',
		method: 'post',
		params: data
	})
}

//下载模板
export function downloadTemplate(data) {
	return downloader({
		url: '/admin/user/download',
		method: 'get',
		params: data
	})
}

//上传文件-共用
export function uploadFile(data) {
	return request({
		url: '/admin/user/adminUser/uploadFile',
		method: 'post',
		data
	})
}

//获取用户名是否存在
export function selectUsernameIsExist(data) {
	return request({
		url: '/admin/user/adminUser/selectUsernameIsExist',
		method: 'get',
		params: data
	})
}

//用户解锁-可批量
export function unlockUserBatch(data) {
	return request({
		url: '/admin/user/adminUser/unlockUserBatch',
		method: 'post',
		params: data
	})
}

//获取当前用户部门下用户
export function adminUserListByDeptId(data) {
	return request({
		url: '/admin/user/adminUser/adminUserListByDeptId',
		method: 'get',
		params: data
	})
}


//查询
export function majorInfoList(data) {
	return request({
		url: '/admin/user/adminUser/adminUserMajorList',
		method: 'get',
		params: data
	})
}
